package com.ruoyi.InboundManagement.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.InboundManagement.mapper.ProductionEceiptMapper;
import com.ruoyi.InboundManagement.domain.ProductionEceipt;
import com.ruoyi.InboundManagement.service.IProductionEceiptService;

/**
 * 生产入库管理Service业务层处理
 * 
 * @author admin
 * @date 2024-07-02
 */
@Service
public class ProductionEceiptServiceImpl implements IProductionEceiptService 
{
    @Autowired
    private ProductionEceiptMapper productionEceiptMapper;

    /**
     * 查询生产入库管理
     * 
     * @param eceiptId 生产入库管理主键
     * @return 生产入库管理
     */
    @Override
    public ProductionEceipt selectProductionEceiptByEceiptId(Long eceiptId)
    {
        return productionEceiptMapper.selectProductionEceiptByEceiptId(eceiptId);
    }

    /**
     * 查询生产入库管理列表
     * 
     * @param productionEceipt 生产入库管理
     * @return 生产入库管理
     */
    @Override
    public List<ProductionEceipt> selectProductionEceiptList(ProductionEceipt productionEceipt)
    {
        return productionEceiptMapper.selectProductionEceiptList(productionEceipt);
    }

    /**
     * 新增生产入库管理
     * 
     * @param productionEceipt 生产入库管理
     * @return 结果
     */
    @Override
    public int insertProductionEceipt(ProductionEceipt productionEceipt)
    {
        productionEceipt.setCreateTime(DateUtils.getNowDate());
        return productionEceiptMapper.insertProductionEceipt(productionEceipt);
    }

    /**
     * 修改生产入库管理
     * 
     * @param productionEceipt 生产入库管理
     * @return 结果
     */
    @Override
    public int updateProductionEceipt(ProductionEceipt productionEceipt)
    {
        return productionEceiptMapper.updateProductionEceipt(productionEceipt);
    }

    /**
     * 批量删除生产入库管理
     * 
     * @param eceiptIds 需要删除的生产入库管理主键
     * @return 结果
     */
    @Override
    public int deleteProductionEceiptByEceiptIds(Long[] eceiptIds)
    {
        return productionEceiptMapper.deleteProductionEceiptByEceiptIds(eceiptIds);
    }

    /**
     * 删除生产入库管理信息
     * 
     * @param eceiptId 生产入库管理主键
     * @return 结果
     */
    @Override
    public int deleteProductionEceiptByEceiptId(Long eceiptId)
    {
        return productionEceiptMapper.deleteProductionEceiptByEceiptId(eceiptId);
    }

    @Override
    public int getProductionReceiptCount(ProductionEceipt productionEceipt) {
        int count = productionEceiptMapper.getProductionReceiptCount(productionEceipt);
        System.out.println(count);
        return count;
    }

}
